<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE hibernate-mapping PUBLIC
    "-//Hibernate/Hibernate Mapping DTD 3.0//EN" 
    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping>
    <class name="cn.firstsoft.modules.workTask.domain.WorkTaskFile" table="work_task_file">
     <id name="id" type="integer">
            <column name="id" />
            <generator class="native" >
				         <param name="sequence">WORK_TASK_FILE_ID_SEQ</param>
            </generator>
     </id>
         <property name="perm" type="string">
               <column name="perm" length="50" />
        </property>
         <property name="createDate" type="timestamp">
               <column name="create_date" length="23" />
        </property>
        
         <set name="workTaskFileAttach" lazy="true" inverse="false" cascade="save-update" batch-size="5">
           <key>
             <column name="work_task_file_id" not-null="true"/>
            </key>
            <one-to-many class="cn.firstsoft.modules.workTask.domain.WorkTaskFileAttach"/>
        </set>
        
        <set name="workTaskFileDept" lazy="true" inverse="false" cascade="save-update" batch-size="5">
           <key>
             <column name="work_task_file_id" not-null="true"/>
            </key>
            <one-to-many class="cn.firstsoft.modules.workTask.domain.WorkTaskFileDept"/>
        </set>

        <set name="workTaskFileUsers" lazy="true" inverse="false" cascade="save-update" batch-size="5">
           <key>
             <column name="work_task_file_id" not-null="true"/>
            </key>
            <one-to-many class="cn.firstsoft.modules.workTask.domain.WorkTaskFileUsers"/>
        </set>
        
        <many-to-one name="workTask" class="cn.firstsoft.modules.workTask.domain.WorkTask" fetch="select">
            <column name="work_task_id"/>
        </many-to-one>
        
        <many-to-one name="workTaskItem" class="cn.firstsoft.modules.workTask.domain.WorkTaskItem" fetch="select">
            <column name="work_task_item_id"/>
        </many-to-one>
        <!--
            To add non XDoclet property mappings, create a file named
                hibernate-properties-WorkTaskFile.xml
            containing the additional properties and place it in your merge dir.
        -->
    </class>

</hibernate-mapping>
